package org.jeecg.report.enums;

import lombok.Getter;

@Getter
public enum SpcD3Enum {
    D3_2(0.0, 2),
    D3_3(0.0, 3),
    D3_4(0.0, 4),
    D3_5(0.0, 5),
    D3_6(0.0, 6),
    D3_7(0.076, 7),
    D3_8(0.136, 8),
    D3_9(0.184, 9),
    D3_10(0.223, 10),
    D3_11(0.256, 11),
    D3_12(0.283, 12),
    D3_13(0.307, 13),
    D3_14(0.328, 14),
    D3_15(0.347, 15),
    D3_16(0.363, 16),
    D3_17(0.378, 17),
    D3_18(0.391, 18),
    D3_19(0.403, 19),
    D3_20(0.415, 20);
    // 成员变量
    private final Double constant;
    private final int num;

    // 构造方法
    SpcD3Enum(Double constant, int num) {
        this.constant = constant;
        this.num = num;
    }

    // 普通方法
    public static Double getConstant(int num) {
        for (SpcD3Enum c : SpcD3Enum.values()) {
            if (c.getNum() == num) {
                return c.constant;
            }
        }
        return null;
    }
}
